package org.example;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-10-30
 * 22:46
 */
import java.util.Scanner;
class Test{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] x=new int[n];
        int[] y=new int[n];
        for(int i=0;i<n;i++){
            x[i]=sc.nextInt();
        }
        for(int i=0;i<n;i++){
            y[i]=sc.nextInt();
        }
        double sum=0;
        for(int i=0;i<n;i++){
            sum+=Math.abs(x[i]-y[i]);
        }
        System.out.printf("%.8f\n",sum);
        double sum1=0;
        for(int i=0;i<n;i++){
            sum1+=Math.pow((x[i]-y[i]),2);
        }
        System.out.printf("%.8f",Math.sqrt(sum1));
        System.out.println();
        sum1=0;
        for(int i=0;i<n;i++){
            sum1+=Math.pow(Math.abs(x[i]-y[i]),3);
        }
        System.out.printf("%.8f\n",Math.cbrt(sum1));
        int[] ni=new int[n];
        for(int i=0;i<n;i++){
            ni[i]=Math.abs(x[i]-y[i]);
        }
        double max=0;
        for(int i=0;i<n;i++){
            max=Math.max(max,ni[i]);
        }
        System.out.printf("%.8f",max);
    }
}